package ace.module.sms.core.impl.manager.supplier.impl;

import ace.module.sms.api.enums.SmsSupplierTypeEnum;
import ace.module.sms.supplier.api.SmsHandler;
import ace.module.sms.supplier.api.SmsHandlerFactory;
import ace.module.sms.supplier.api.dto.SupplierConfigDto;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @author caspar
 * @date 2023/10/25 9:13
 */
@Slf4j
@AllArgsConstructor
@Component
public class TestSmsHandlerFactoryImpl implements SmsHandlerFactory {

  @Override
  public SmsHandler getOrCreate(SupplierConfigDto config) {
    return new TestSmsHandlerImpl();
  }

  @Override
  public boolean isSupport(String type) {
    return SmsSupplierTypeEnum.TEST.getCode().equals(type);
  }
}
